package com.googlecode.stemwijzer.client.event;

import com.google.gwt.event.shared.GwtEvent;
import com.googlecode.stemwijzer.client.event.handler.RegistrationHandler;

public final class RegistrationEvent extends GwtEvent<RegistrationHandler> {

	public static final Type<RegistrationHandler> TYPE = new Type<RegistrationHandler>();
	private final String userName;

	public RegistrationEvent(final String userName) {
		this.userName = userName;
	}

	@Override
	public Type<RegistrationHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(RegistrationHandler handler) {
		handler.onRegistration(this);
	}

	public String getUserName() {
		return userName;
	}
}
